﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Diagnostics;
using System.Text;
using System.Windows.Forms;

namespace Framework.Platform.Components.UI.Field
{
    public partial class TextBoxField : TextBox, IField
    {
        public TextBoxField()
        {
            InitializeComponent();
        }

        public TextBoxField(IContainer container)
        {
            container.Add(this);

            InitializeComponent();
        }

        #region IField Members

        public event EventHandler<FieldFocusEventArgs> FieldFocus;

        private object _FieldDataSource;
        public object FieldDataSource
        {
            get
            {
                return this._FieldDataSource;
            }
            set
            {
                _FieldDataSource = value;
            }
        }

        private string _FieldBindProperty;
        public string FieldBindProperty
        {
            get
            {
                return _FieldBindProperty;
            }
            set
            {
                _FieldBindProperty = value;
            }
        }

        private string _FieldKey;
        public string FieldKey
        {
            get
            {
                return _FieldKey;
            }
            set
            {
                _FieldKey = value;
            }
        }

        public void FieldValidate()
        {
            //TODO
        }

        public void FieldDataBind()
        {
            //TODO
        }
        #endregion

        protected void OnFieldFocus(FieldFocusEventArgs e)
        {
            if (this.FieldFocus != null)
            {
                this.FieldFocus(this, e);
            }
        }
    }
}
